namespace GameStore2.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Games",
                c => new
                    {
                        GameId = c.Int(nullable: false, identity: true),
                        GameCompanyId = c.Int(nullable: false),
                        Name = c.String(),
                    })
                .PrimaryKey(t => t.GameId)
                .ForeignKey("dbo.GameCompanies", t => t.GameCompanyId, cascadeDelete: true)
                .Index(t => t.GameCompanyId);
            
            CreateTable(
                "dbo.GameCompanies",
                c => new
                    {
                        GameCompanyId = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                    })
                .PrimaryKey(t => t.GameCompanyId);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.Games", new[] { "GameCompanyId" });
            DropForeignKey("dbo.Games", "GameCompanyId", "dbo.GameCompanies");
            DropTable("dbo.GameCompanies");
            DropTable("dbo.Games");
        }
    }
}
